class Auction < ActiveRecord::Base
  attr_accessible :auction_type, :finish, :name, :start, :user_id
  belongs_to :products
  belongs_to :user
  
  validates_length_of :name, :minimum => 6
  validates :start, :date => { :before => Time.now }
  validates :finish, :date => { :after => Time.now }
  validates :finish, :date => { :after => :start }
  belongs_to :auction_type
end
